package com.example.demo.dao.user;

import com.example.demo.entity.user.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Set;


public interface UserMapper extends BaseMapper<User> {

    @Select("select r.rolename from t_user  u LEFT JOIN t_user_role  ur on  u.id = ur.user_id LEFT JOIN t_role r on ur.role_id = r.id where u.username = #{userName}")
    Set<String> getRolesByUserName(@Param("userName") String userName);
}
